Skip to content

ci(release): release-gate skeleton for the heavy lanes (M3, #922) - #1113

Closed
Guess-Who-sec wants to merge 3 commits into
metrico:masterfrom
Guess-Who-sec:ci/m3-release-gate
Closed

Guess-Who-sec wants to merge 3 commits into
metrico:masterfrom
Guess-Who-sec:ci/m3-release-gate

Conversation

@Guess-Who-sec

Copy link
Copy Markdown
Contributor

Part of #922 (M3): the release-gate skeleton. Is this wanted? Your split of #922 on 09-18 didn't mention this item, so I've built it as #922 describes it. If you'd rather not have it, or want it in another form, say so and I'll close or change it.

Depends on #1067 (publish preflight): this branch is built on it, so its first 2 commits are #1067's. Merge #1067 first; I'll rebase this one onto master then. Only the last commit is new here.

What it does

Heavy lanes become release gates. The cluster e2e lane (Gigapipe CI Cluster) and the k6 lane still start on every PR, but their job only runs on:

  • a push to master (cluster lane: also beta, as today)
  • the nightly run (new schedule: cluster 02:17 UTC, k6 02:47 UTC)
  • a manual run from the Actions tab (workflow_dispatch, new for the cluster lane)
  • a PR from a release/* branch

On any other PR the job is skipped. GitHub shows it as skipped; a job skipped by its if: counts as passing for required checks, so it doesn't block merging.

Merges don't pile up runs. Push runs of each lane share a concurrency group with cancel-in-progress: false: one runs, the newest push waits, and a newer push replaces the waiting one (it ends cancelled). Nightly, manual and PR runs each get their own group, so a push never cancels them.

Preflight (#1067's script): a lane only counts if its job actually ran. A run whose job was skipped is passed over, and an older run of that lane on the commit decides. If the commit has no run that ran, or the run was cancelled because a newer push replaced it, the release is refused and the message says to start the lane by hand on the released branch.

docs/contributing.md: says when the e2e and k6 lanes run, and to run make e2e-full locally or start the lane by hand when a change can affect them.

Not in this PR:

Verification

Static: actionlint reports the same 17 shellcheck info/style notes in k6_test.yml before and after (all in steps this PR doesn't touch), none in the cluster lane; shellcheck clean on the preflight script.

Real runs on my fork, with master + #1067 + this commit pushed as the fork's master (since restored):

Case Cluster e2e k6
push to master ran, success (run) ran, success (run)
2nd push while the 1st ran waited, then replaced: cancelled (run) cancelled (run)
3rd push right after ran, success (run) ran, success (run)
ordinary PR job skipped (run) job skipped (run)
release/* PR ran, success (run) ran, success (run)
manual run ran, success, 2 runs (1, 2) not run by hand

Real cluster runs took 7-9 minutes; skipped ones 0 seconds. All 25 steps of each k6 run passed (the job has continue-on-error, so I checked the steps, not only the job). The ordinary PR showed both lanes as "skipping" and was mergeable.

Preflight, run against those fork commits with Go Build CI, Gigapipe CI Cluster and K6 Test metrico/gigapipe as required lanes:

  • ordinary PR commit: refused (exit 1); both heavy lanes "has no run ... that ran its jobs; start it by hand"
  • the replaced push: refused (exit 1); both lanes "was cancelled ..., so it never ran; start it by hand"
  • release/* PR commit: passed (exit 0)
  • 3rd push commit while a manual cluster run was in progress on it: reported "still running" and waited (2 polls; that invocation then lost my network connection). Run again after the manual run finished: passed (exit 0), deciding on the newest run

For comparison, #1067's current script also refuses the ordinary PR commit (a run whose jobs were all skipped concludes skipped, not success), but it can't look past that run to an older real run of the same lane, and its message doesn't say what to do.

Not verified:

  • The nightly schedule: not waited for; it goes through the same if: as a manual run.
  • Required checks: my fork has none, so "skipped counts as passing" rests on GitHub's documented behaviour, not on a test here.

Potential risks

  • PRs no longer run e2e or k6. A change that breaks them merges green and shows up on the next master push or nightly run. Authors can run make e2e-full or start the lane by hand.
  • A replaced push run leaves that commit unverified. Releasing exactly that commit is refused until the lane is started by hand. Releasing the newer commit is unaffected.
  • Commits that only touch **.md or **.yaml get no cluster run (paths-ignore, unchanged). Releasing such a commit is refused until the lane is started by hand. Same as with ci(release): publish preflight and CI trigger fixes (M3, #922) #1067 alone.
  • Overlap with ci(k6): build and test this commit's image (M3, #922) #1070: that PR changes the k6 job's steps, this one its triggers and if:. Whichever merges second needs a small rebase.
  • Nightly runs cost runner time every day: 7-9 minutes for the cluster lane plus the k6 run.

- build_release.yml: a first "Publish preflight" job refuses to publish
  unless every workflow in PUBLISH_REQUIRED_LANES (Go Build CI, Gigapipe CI
  Cluster) passed on the commit being released. Lanes are matched by
  workflow name because job names are not unique (two jobs are "build").
- go.yml: also run on pushes to master, so unit tests run on the merged
  commit and the preflight has a result to check.
- node-clickhouse-cluster.js.yml: stop ignoring '**.yml' changes, so
  workflow and compose edits run the cluster lane.
Releases are usually created right after a merge, while that merge's lanes
are still running: v5.6.0 started at 13:36:24 and the cluster lane on the
same commit finished at 13:38:56. Instead of refusing a lane that has not
finished, check it again every PREFLIGHT_POLL_SECONDS (30) for up to
PREFLIGHT_WAIT_SECONDS (1800). A missing or failed lane still refuses at
once.
The cluster e2e lane and the k6 lane now start on every PR but only run
their job on a push to master, nightly, a manual run or a PR from a
release/* branch. On any other PR the job is skipped, which shows as
skipped and counts as passing. Push runs share a concurrency group without
cancelling the running one, so rapid merges queue at most one more run;
nightly, manual and PR runs are never replaced by a push.

The publish preflight passes over a run whose job was skipped and decides
on an older run of the lane, and says how to start a lane by hand when it
has no run that ran, or its run was cancelled.

@rita7lopes rita7lopes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed my mind on this part of #922: I'd rather keep e2e and k6 on every PR, so a break shows up before merging. Closing this one @Guess-Who-sec.

@rita7lopes rita7lopes closed this Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants